import { Message } from "element-ui";
import { ref } from "vue";

export const useCostType = (request: any) => {
  const costType = ref([
    {
      businessId: "0",
      costType: "",
      description: "",
    },
  ]);
  const getCostT = async () => {
    const res = await request({});
    console.log("res", res);
    if (res && res.data) {
      costType.value = res.data;
    } else {
      Message.error("获取成本类型失败");
    }
  };
  return {
    costType,
    getCostT,
  };
};
